R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Including Plots

You can also embed plots, for example like this:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

##    Variable             Unit               Value        
##  Length:10          Length:10          Min.   :  69507  
##  Class :character   Class :character   1st Qu.: 527665  
##  Mode  :character   Mode  :character   Median :1224312  
##                                        Mean   :2537489  
##                                        3rd Qu.:3900242  
##                                        Max.   :8884615  
##                                        NA's   :1
html, no head
Variable Unit Value
Aviation Sector Energy Demand PJ/yr 527664.97
Buildings Energy Demand PJ/yr 8884615.13
Final Energy Demand PJ/yr NA
Manufacturing Energy Demand PJ/yr 4375078.45
Maritime Sector Energy Demand PJ/yr 426099.41
NonEnergy Demand PJ/yr 1224311.60
Other Energy Demand PJ/yr 649651.97
Rail Sector Energy Demand PJ/yr 69506.81
Road Sector Energy Demand PJ/yr 2780227.38
Transport Energy Demand PJ/yr 3900242.47
html with head
Variable Unit Value
Aviation Sector Energy Demand PJ/yr 527664.97
Buildings Energy Demand PJ/yr 8884615.13
Final Energy Demand PJ/yr NA
Manufacturing Energy Demand PJ/yr 4375078.45
Maritime Sector Energy Demand PJ/yr 426099.41
NonEnergy Demand PJ/yr 1224311.60
Other Energy Demand PJ/yr 649651.97
Rail Sector Energy Demand PJ/yr 69506.81
Road Sector Energy Demand PJ/yr 2780227.38
Transport Energy Demand PJ/yr 3900242.47

Make a table

Create a subset of the mtcars data.

Variable Unit Value
Aviation Sector Energy Demand PJ/yr 527664.97
Buildings Energy Demand PJ/yr 8884615.13
Final Energy Demand PJ/yr NA
Manufacturing Energy Demand PJ/yr 4375078.45
Maritime Sector Energy Demand PJ/yr 426099.41
NonEnergy Demand PJ/yr 1224311.60
Other Energy Demand PJ/yr 649651.97
Rail Sector Energy Demand PJ/yr 69506.81
Road Sector Energy Demand PJ/yr 2780227.38
Transport Energy Demand PJ/yr 3900242.47
…1 Time Value
1 2020-01-01 12:00:00 97.191026
2 2020-01-01 13:00:00 -62.214022
3 2020-01-01 14:00:00 -29.273686
4 2020-01-01 15:00:00 5.643089
5 2020-01-01 16:00:00 154.454622
6 2020-01-01 17:00:00 -5.879389
7 2020-01-01 18:00:00 -136.882096
8 2020-01-01 19:00:00 85.002703
9 2020-01-01 20:00:00 -47.983528
10 2020-01-01 21:00:00 83.348507